<template>
  <weighbill-designer
    :widget-options="widgetOptions"
    :temp-value="tempValue"
    @save="saveTemp"
    @preview="previewTemp"
  ></weighbill-designer>
</template>

<script>
import { defineComponent } from "vue";
export default defineComponent({
  setup() {
    const widgetOptions = [
      {
        type: "braid-txt",
        isEdit: 1,
        title: "自定义文本",
        value: "自定义文本",
        defaultValue: "自定义文本",
        name: "",
      },
      {
        type: "braid-txt",
        isEdit: 0,
        title: "公司名称",
        value: "{公司名称}",
        defaultValue: "某某公司",
        name: "companyName",
      },
    ];

    const saveTemp = (temp) => {
      console.log("保存模板", temp);
    };
    const previewTemp = (temp) => {
      console.log("预览模板", temp);
    };

    return {
      widgetOptions,
      saveTemp,
      previewTemp,
    };
  },
});
</script>
